package com.example.zerox.controller;

import com.example.zerox.pojo.Fruit;
import com.example.zerox.service.SysFruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class FruitController {
    @Autowired
    private SysFruitService service;

    @GetMapping("/list")
    public String list(Model model){
        List<Fruit> list = service.list();
        model.addAttribute("list",list);
        return "list";
    }
}
